<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorate="layout">
<head>
    <title>题库管理</title>
</head>
<body>
<!--<h1 layout:fragment="header">Messages : View all</h1>-->
<div layout:fragment="content">
    <div class="box-header with-border">
        <h3 class="box-title">题库管理</h3>
    </div>
    <!-- /.box-header -->
    <!-- form start -->
    <form class="form-horizontal" role="form"id="questionFrom">
        <div class="box-body">
            <div class="form-group">
                <div class="form-group col-md-3">
                    <label for="question_num" class="col-sm-5 control-label">考题数量</label>
                    <div class="col-xs-7 no-padding">
                        <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
                        <input type="hidden" id="id" name="id">
                        <input type="text" class="form-control" id="question_num" data-rule="required(考题数量)" name="question_num" placeholder="考题数量">
                    </div>
                </div>
                <div class="form-group col-md-3">
                    <label for="question_time" class="col-sm-5 control-label">考题时间(分)</label>
                    <div class="col-xs-7 no-padding">
                        <input type="text" class="form-control" id="question_time" data-rule="required(考题时间)" name="question_time" placeholder="考题时间">
                    </div>
                </div>
                <div class="form-group col-md-3">
                    <label for="question_type" class="col-sm-5 control-label">考题方式</label>
                    <div class="col-xs-7 no-padding">
                        <input type="text" class="form-control" id="question_type" data-rule="required(考题方式)" name="question_type" readonly="readonly" placeholder="考题方式">
                    </div>
                </div>
                <div class="form-group col-md-3">
                    <label for="question_pass" class="col-sm-5 control-label">通过标准(题)</label>
                    <div class="col-xs-7 no-padding">
                        <input type="text" class="form-control" id="question_pass" data-rule="required(通过标准)" name="question_pass" placeholder="通过标准">
                    </div>
                </div>
            </div>
            <div class="form-group ">
                <div class="col-sm-6 right-button">
                    <button onclick="question_confirm()" type="button" class="btn btn-success right-button">确认</button>
                    <button onclick="temp_download()" type="button" class="btn btn-success right-button">模板下载</button>
                    <button onclick="import_question()" type="button" class="btn btn-danger right-button">导入</button>
                    <button onclick="output_question()" type="button" class="btn btn-danger right-button">导出</button>
                </div>

            </div>
        </div>

    </form>
    <div class="box-body">
        <table id="question" class="table table-bordered table-striped">
            <thead>
            <tr>
                <th>序号</th>
                <th>题目</th>
                <th>正确答案</th>
                <th>A</th>
                <th>B</th>
                <th>C</th>
                <th>D</th>
                <th>E</th>
                <th>F</th>
                <th>G</th>
                <th>H</th>
            </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>
    <div id="question-modal-form" class="modal" tabindex="-1" aria-hidden="true" style="display: none;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">×</button>
                    <h4 class="blue bigger">题库导入</h4>
                </div>
                <form action="../../admin/question/import" id="questionFileForm" method="post" enctype="multipart/form-data">
                    <div class="modal-body">
                        <fieldset>
                            <div class="form-group">
                                <label class="col-sm-3 control-label no-padding-right">导入题库：</label>
                                <div class="">
                                    <input type="file" id="importQuesFile" name="questionFile"/>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                    <div class="modal-footer">
                        <button type="reset" class="btn btn-sm" data-dismiss="modal">
                            <i class="ace-icon fa fa-times"></i>
                            返回
                        </button>
                        <button type="button" onclick="submitQuestionFile()" class="btn btn-sm btn-primary">
                            <i class="ace-icon fa fa-check"></i>
                            提交
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="../../static/js/pages/question.js"></script>
</div>
</body>
</html>